@extends('user.base_guest')
@section('title', '找回密码')
@section('content')
    <div class="layui-container dhbwl-marginTop">
        <div class="dhbwl-panel dhbwl-panel-user" pad20>
            <div class="layui-tab layui-tab-brief" lay-filter="user">
                <ul class="layui-tab-title">
                    <li><a href="{{route('login')}}">登入</a></li>
                    <li class="layui-this">找回密码<!--重置密码--></li>
                </ul>
                <div class="layui-form layui-tab-content" id="LAY_ucm" style="padding: 20px 0;">
                    <div class="layui-tab-item layui-show">
                        <!-- 重置密码 -->

      <div class="dhbwl-msg">{{ $email ?? old('email') }}，请重置您的密码</div>
      <div class="layui-form layui-form-pane"  style="margin-top: 30px;">
        <form action="{{ route('password.update') }}" method="post">
            @csrf
            <input type="hidden" name="token" value="{{ $token }}">
            <input type="hidden" name="email" value="{{ $email ?? old('email') }}">
          <div class="layui-form-item">
            <label  class="layui-form-label">密码</label>
            <div class="layui-input-inline">
              <input type="password" id="L_pass" name="password" required lay-verify="required" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">6到16个字符</div>
          </div>
          <div class="layui-form-item">
            <label  class="layui-form-label">确认密码</label>
            <div class="layui-input-inline">
              <input type="password" id="L_repass" name="password_confirmation"  autocomplete="off" class="layui-input">
            </div>
          </div>

          <div class="layui-form-item">
            <button class="layui-btn" alert="1" lay-filter="*" lay-submit>提交</button>
          </div>
        </form>
      </div>







                    </div>
                </div>
            </div>
        </div>


    </div>
@include('user._footer')
<script src="/static/js/user.js"></script>
<script src="/static/js/layui/layui.all.js"></script>
    <script>
        layui.use(['form'], function () {
            var form = layui.form,
                layer = layui.layer;
            @if (session('status'))
            layer.alert(' 取回密码的方法已经通过Email发送到您的邮箱，请尽快修改密码', {
                icon: 2,
                title: '错误信息',
                skin: 'layui-layer-molv' //样式类名
                , closeBtn: 0
            });
                @endif
            var allError = "";
            @if ($errors->any())
                @foreach ($errors->all() as $error)
                allError += "{{$error}}<br/>";
            @endforeach
            layer.alert(allError, {
                icon: 2,
                title: '错误信息',
                skin: 'layui-layer-molv' //样式类名
                , closeBtn: 0
            });
            @endif
        });
    </script>

@endsection
